<form action="<?= base_url() ?>utama/proses_update_pegawai" method="post" class="validate" novalidate="novalidate">
	<div id="main_content">
		<div class="grid_6" style="margin-right: 50%">
			<div class="box">
				<div class="header">
					<h3>
						Tambah Pegawai
					</h3>
				</div>
				<div class="content no-padding with-actions">
					<div class="section _100">
						<label for="nama_pegawai">
							Nama Pegawai
						</label>
						<div>
							<input maxlength="45" class="required" name="nama_pegawai" id="nama_pegawai" value="<?= $pegawai['nama_pegawai'] ?>"/>
						</div>
					</div>
					<div class="section _100">
						<label for="tanggal_lahir">
							Tanggal Lahir
						</label>
						<div>
							<input type="text" class="required dateISO" name="tanggal_lahir" id="tanggal_lahir" value="<?= $pegawai['tanggal_lahir'] ?>"/>
						</div>
					</div>
					<div class="section _100">
						<label for="no_telpon">
							Nomor Telepon
						</label>
						<div>
							<input maxlength="20" type="text" class="required" name="no_telpon" id="no_telpon" value="<?= $pegawai['no_telpon'] ?>"/>
						</div>
					</div>
					<div class="section _100">
						<label for="alamat">
							Alamat
						</label>
						<div>
							<input maxlength="100" type="text" class="required" name="alamat" id="alamat" value="<?= $pegawai['alamat'] ?>"/>
						</div>
					</div>
					<div class="section _100">
						<label for="email">
							Email
						</label>
						<div>
							<input maxlength="100" type="text" class="required email" name="email" id="email" value="<?= $pegawai['email'] ?>"/>
						</div>
					</div>
					<div class="section _100">
						<label maxlength="45" for="username">
							Username
						</label>
						<div>
							<input maxlength="45" type="text" class="required" name="username" id="username" value="<?= $pegawai['username'] ?>"/>
						</div>
					</div>
					<div class="section _100">
						<label for="password">
							Password
						</label>
						<div>
							<input maxlength="45" type="password" class="required" name="password" id="password" value="<?= $pegawai['password'] ?>"/>
						</div>
					</div>
					<div class="section _100">
						<span class="label">
							Jabatan
						</span>
						<div>
							<select name="jabatan" class="required">
								<option value="direktur_utama" <?php if (strcmp($pegawai['jabatan'], "direktur_utama") == 0) echo "selected='selected'" ?>>
									Direktur Utama
								</option>
								<option value="sekretaris" <?php if (strcmp($pegawai['jabatan'], "sekretaris") == 0) echo "selected='selected'" ?>>
									Sekretaris
								</option>
								<option value="direktur_teknik" <?php if (strcmp($pegawai['jabatan'], "direktur_teknik") == 0) echo "selected='selected'" ?>>
									Direktur Teknik
								</option>
								<option value="admin" <?php if (strcmp($pegawai['jabatan'], "admin") == 0) echo "selected='selected'" ?>>
									Admin
								</option>
								<option value="divisi_interior" <?php if (strcmp($pegawai['jabatan'], "divisi_interior") == 0) echo "selected='selected'" ?>>
									Divisi Interior
								</option>
								<option value="divisi_estetika" <?php if (strcmp($pegawai['jabatan'], "divisi_estetika") == 0) echo "selected='selected'" ?>>
									Divisi Estetika
								</option>
								<option value="divisi_arsitektur" <?php if (strcmp($pegawai['jabatan'], "divisi_arsitektur") == 0) echo "selected='selected'" ?>>
									Divisi Arsitektur
								</option>
								<option value="kepala_studio" <?php if (strcmp($pegawai['jabatan'], "kepala_studio") == 0) echo "selected='selected'" ?>>
									Kepala Studio
								</option>
								<option value="drafter_operator" <?php if (strcmp($pegawai['jabatan'], "drafter_operator") == 0) echo "selected='selected'" ?>>
									Drafter / Operator
								</option>
							</select>
						</div>
					</div>
				</div>
				<div class="actions" style="padding: 20px 0px 20px 0px">
					<div class="actions-right">
						<input name="submit" type="submit" value="simpan"/>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
</div>
<input type="hidden" value="<?= $pegawai['idPegawai'] ?>" name="id_pegawai" />
</form>

<script type="text/javascript">
	$(function (){
		$("#tanggal_lahir").datepicker({ dateFormat: 'yy-mm-dd' });
	});
</script>
</script>
<script type="text/javascript">
	//<![CDATA[
    $(window).load(function () {
		var a = $("form").validate({
			invalidHandler: function (d, b) {
				var e = b.numberOfInvalids();
				if (e) {
					var c = e == 1 ? "Anda hanya mengisi 1 field, field kosong telah ditandai" : "Anda tidak mengisi " + e + " fields. Field tersebut telah ditandai.";
					$(".box .content").removeAlertBoxes();
					$(".box .content").alertBox(c, {
						type: "warning",
						icon: true,
						noMargin: false
					});
					$(".box .content .alert").css({
						width: "",
						margin: "0",
						borderLeft: "none",
						borderRight: "none",
						borderRadius: 0
					})
				} else {
					$(".box .content").removeAlertBoxes()
				}
			},
			showErrors: function (c, d) {
				this.defaultShowErrors();
				var b = this;
				$.each(d, function () {
					var f = $(this.element);
					var e = f.parent().find("label.error").hide();
					e.addClass("red");
					e.css("width", "");
					f.trigger("labeled");
					e.fadeIn()
				})
			},
			submitHandler: function (b) {
				$("form").submit();
			}
		})
	});
    //]]>
</script>